<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.company.ems.model.User" %>
<%
    User user = (User) session.getAttribute("user");
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>员工管理系统 - 页面未找到</title>
    <link rel="stylesheet" href="../css/style.css">
    <style>
        .error-container {
            text-align: center;
            padding: 60px 20px;
        }
        .error-code {
            font-size: 120px;
            font-weight: bold;
            color: #dc3545;
            margin-bottom: 20px;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
        }
        .error-message {
            font-size: 24px;
            color: #6c757d;
            margin-bottom: 30px;
        }
        .error-description {
            font-size: 16px;
            color: #6c757d;
            margin-bottom: 40px;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
        }
        .error-actions {
            margin-top: 30px;
        }
        .error-actions .btn {
            margin: 0 10px;
        }
        .error-icon {
            font-size: 80px;
            color: #dc3545;
            margin-bottom: 20px;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 头部 -->
        <div class="header">
            <h1>员工管理系统</h1>
            <% if (user != null) { %>
                <div class="user-info">
                    <span>欢迎，<%= user.getUsername() %></span>
                    <a href="../logout" class="btn btn-secondary">退出登录</a>
                </div>
            <% } %>
        </div>
        
        <!-- 内容区域 -->
        <div class="content">
            <div class="error-container">
                <div class="error-icon">⚠️</div>
                <div class="error-code">404</div>
                <div class="error-message">页面未找到</div>
                <div class="error-description">
                    抱歉，您访问的页面不存在或已被移除。<br>
                    请检查URL是否正确，或者返回首页继续浏览。
                </div>
                <div class="error-actions">
                    <% if (user != null) { %>
                        <a href="../dashboard" class="btn btn-primary">返回仪表板</a>
                        <a href="../employee/" class="btn btn-info">员工管理</a>
                    <% } else { %>
                        <a href="../login.jsp" class="btn btn-primary">返回登录</a>
                    <% } %>
                    <a href="javascript:history.back()" class="btn btn-secondary">返回上一页</a>
                </div>
            </div>
        </div>
    </div>
    
    <script>
        // 自动跳转（可选）
        setTimeout(function() {
            <% if (user != null) { %>
                window.location.href = '../dashboard';
            <% } else { %>
                window.location.href = '../login.jsp';
            <% } %>
        }, 10000); // 10秒后自动跳转
    </script>
</body>
</html>